package com.hongning.railway.ui.main.fragments.cadremanagement;

import android.arch.lifecycle.ViewModelProviders;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.ViewGroup;

import com.hongning.railway.BR;
import com.hongning.railway.R;
import com.hongning.railway.app.AppViewModelFactory;
import com.hongning.railway.databinding.FragmentCadreassessmentBinding;

import me.goldze.mvvmhabit.base.BaseFragment;

public class CadreAssessmentFragment extends BaseFragment<FragmentCadreassessmentBinding,CadreAssessmentViewModel> {
    @Override
    public int initContentView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        return R.layout.fragment_cadreassessment;
    }
    public static CadreAssessmentFragment newInstance() {

        Bundle args = new Bundle();

        CadreAssessmentFragment fragment = new CadreAssessmentFragment();
        fragment.setArguments(args);
        return fragment;
    }
    @Override
    public int initVariableId() {
        return BR.assessmentViewModel;
    }

    @Override
    public void initData() {
        super.initData();
        viewModel.loadData();
    }

    @Override
    public CadreAssessmentViewModel initViewModel() {
        AppViewModelFactory appViewModelFactory = AppViewModelFactory.getInstance(getActivity().getApplication());
        return ViewModelProviders.of(this,appViewModelFactory).get(CadreAssessmentViewModel.class);
    }
}
